<template>
	<view class="box">
	<!-- 	<view class="font_27 color_fff top flex7">账户余额提现到个人微信，微信平台会收取{{tixian_rate}}%手续费</view> -->
		<view class="bg_f2 font_35 text_bold top_title">到账店长微信零钱</view>
		<view class="content">
			<view class="hidden">
				<view class="font_29 text_bold withdraw_m1">提现金额<text class="color_ff0008 font_23"
						style="font-weight: 500;margin-left: 16rpx;">(提现最小金额1.00)</text></view>
			</view>
			<view class="input_wrapper flex4 van-hairline--bottom">
				<view>￥</view>
				<view class="w_flex1">
					<input type="number" v-model="price" />
				</view>
			</view>
			<view class="des font_23 color_ac flex8">
				<view>当前账户余额 {{balance}}元</view>
				<view class="color_ff6a00" style="padding: 10rpx 0;" @click="price = balance;">全部提现</view>
			</view>
		</view>
		<view class="foot_wrapper flex9">
			<view class="bg_ff6a00 font_33 color_fff flex7" @click="get_sure">提现</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				price: '',
				balance: '--',
				tixian_rate: '--',
			}
		},
		onLoad() {
			this.getBaseConfig();
			this.managerIndex();
		},
		methods: {
			// 小程序基本配置
			getBaseConfig() {
				this.$http.get(this.$api.getBaseConfig).then(res => {
					this.tixian_rate = res.data.rate;
				})
			},
			// 门店信息
			managerIndex() {
				this.$http.get(this.$api.managerIndex).then(res => {
					this.balance = res.data.balance;
				})
			},
			get_sure() {
        console.log('this.price===>',this.price);
        // return
				if (!this.price) return getApp().get_msg('请输入提现金额');

				this.$http.post(this.$api.withdraw, {
					price: this.price
				}).then(res => {
					getApp().get_msg('提现成功');
					getApp().get_back();
				})
			}
		}
	}
</script>

<style lang="less">
	.box {
		padding: 0 0 222rpx 0;
		box-sizing: border-box;
	}

	.top {
		height: 87rpx;
		background-color: #FF0000;
	}

	.top_title {
		padding: 44rpx 44rpx 133rpx;
	}

	.content {
		margin-top: -20rpx;
		margin-bottom: 50rpx;
		background-color: #fff;
		border-radius: 35rpx 35rpx 0px 0px;
	}

	.withdraw_m1 {
		margin: 60rpx 0 27rpx 62rpx;
	}

	.input_wrapper {
		margin: 0 62rpx;
		padding: 0 0 15rpx;
		font-size: 77rpx;
		line-height: 108rpx;
		font-weight: bold;

		view {
			&:first-child {
				margin-right: 20rpx;
			}
		}

		input {
			width: 100%;
			height: 100%;
		}
	}

	.des {
		margin: 38rpx 62rpx 0;
	}

	.foot_wrapper {
		bottom: 0;
		left: 0;
		right: 0;
		position: fixed;

		view {
			width: 167rpx;
			height: 113rpx;
			border-radius: 6rpx;
			margin: 0 46rpx 121rpx 0;
		}
	}

	.box /deep/ .van-hairline--bottom:after {
		border-bottom-color: #D2D2D2;
	}
</style>
